<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <title>供需发布</title>
    <link rel="shortcut icon" href="images/favicon.ico" type="image/vnd.microsoft.icon">
    <link rel="icon"href="images/favicon.ico" type="image/vnd.microsoft.icon">
    <link rel="stylesheet" href="css/reset.css" type="text/css" />
    <link rel="stylesheet" href="css/style_7.css" type="text/css" />
    <link rel="stylesheet" href="css/style2.css" type="text/css" />
    <link rel="stylesheet" href="css/login.css" type="text/css" />
    <link href="css/css.css" rel="stylesheet" /><!-- new -->
    <link href="css/bootstrap.min.css" rel="stylesheet"  /><!-- new -->
    <link href="css/style_1.css" rel="stylesheet"  />

    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/index_animate.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/Tony_Tab.js"></script>
    <script src="js/index.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/prompt.js"></script>


</head>
<body>
<body>
<div th:replace="naviga :: top"></div>
<div th:replace="naviga :: nav(4)"></div>




<link rel="stylesheet" href="css/style_8.css" type="text/css">
<div class="add_supply_container">
    <div class="add_supply_content">
        <h2><img src="images/fabu.png" />发布供应</h2>
        <div class="add_supply_main_content">
            <form method="post" id="supForm">
                <div class="content">
                    <h4 class="info_title">数据信息</h4>
                    <div class="form-group">
                        <label style="margin-top: 0px;"><span>*</span>类<i></i>型</label>
                        <input type="radio" name="leixing" value="0" disabled="disabled" ><span>数据需求</span>
                        <input type="radio" name="leixing" value="1" checked="checked"><span>数据供应</span>
                    </div>
                    <div class="form-group">
                        <label><span>*</span>标<i></i>题</label>
                        <input type="text" class="form-control" name="name" id="name" placeholder="数据供需的简要名称,限制20字以内" />
                    </div>
                    <div class="form-group">
                        <label><span>*</span>简<i></i>述</label>
                        <textarea type="text" class="form-control" id="describes" name="describes" placeholder="简单概括，限制在100字内。" style="height: 82px" /></textarea>
                    </div>
                    <div class="form-group xiangqing">
                        <label><span>*</span>详<i></i>情</label>
                        <textarea cols="1" rows="7" type="text" class="form-control" id="dataDetails" name="dataDetails"
                                  placeholder="请详细描述数据信息，如：&#10;时间范围：2015年~2017年&#10;地域范围：全国&#10;数据字段：所属月份 、省份名称  、城市名称 、 区县名称 、 区域标签、商品数、平均价格、 商品销售量、 商品销售额 、&#10;好评数、 中评数、平台名称&#10;数据量：100万。&#10;"
                        /></textarea>
                    </div>
                    <div class="form-group">
                        <label><span>*</span>交付形式</label>
                        <select type="text" name="deliver" id="deliver" class="form-control">
                            <option value="">请选择交付方式</option>
                            <option value="API">API</option>
                            <option value="数据集">数据集</option>
                            <option value="数据报告">数据报告</option>
                            <option value="其他">其他</option>
                        </select>
                    </div>

                    <div class="form-group end_time">
                        <label><span>*</span>截止时间</label>
                        <input type="text" class="form-control" id="deadline" onfocus="showDate()" name="deadline" placeholder="" />
                        <input type="checkbox" name="noendtime" /><span>长期有效</span>
                    </div>
                </div>
                <div class="content" style="padding-bottom: 0;">
                    <h4 class="info_title">联系方式</h4>
                    <div class="form-group">
                        <label><span style="padding: 0 3.5px"></span>单位名称</label>
                        <input type="text" class="form-control" name="merchantName" id="merchantName" placeholder="请填写单位名称,个人用户无需填写" />
                    </div>
                    <div class="form-group">
                        <label><span>*</span>联<i style="padding: 0 3.5px"></i>系<i style="padding: 0 3.5px"></i>人</label>
                        <input type="text" class="form-control" name="contacts" id="contacts" placeholder="联系人姓名" />
                    </div>
                    <div class="form-group phone">
                        <label><span>*</span>联系手机</label>
                        <input type="phone" class="form-control" name="telephone" placeholder="联系手机" id="telephone" /><input type="checkbox" name="editPhone" /><span>修改手机号</span>
                        <div class="phone_change">
                            <input type="text" class="form-control" name="phoneCode" placeholder="请填写手机验证码" >
                            <a href="javascript:void(0)" class="btn btn-default">获取验证码</a>
                        </div>
                    </div>
                    <div class="form-group yanzheng">
                        <label><span>*</span>验<i style="padding: 0 3.5px"></i>证<i style="padding: 0 3.5px"></i>码</label>
                        <input type="text" name="imgcode" class="form-control" /><img src="/home/login/code.html" onclick="get_img_code(this)"/>
                    </div>
                </div>
                <div class="bottom_content">
                    <p><input type="radio" name="agree">我已阅读同意<a href="#">数据共享协议</a></p>
                </div>
                <div class="foot_content">
                    <a href="javascript:void(0)" id="_submit" class="btn btn-primary">确认发布</a>
                    <p class="wrong_msg"></p>
                </div>
            </form>
        </div>
    </div>
    <div id="mask" class="info_modal" style="display: none;">
        <div class="info_modal_content animated bounceInDown ">
            <div class="prompt_content">
                <img src="images/automan.png">
                <p>发布成功，管理员在1个工作日内进行审核，请耐心等待。</p>
                <p>系统在<span id="countdown">5</span>秒内自动跳转到供需撮合</p>
                <div>
                    <a href="/">返回首页</a>
                    <a href="/supdemand/list/index.html">供需撮合</a>
                </div>
            </div>
        </div>
    </div>
</div>


<div th:replace="footer :: footer"></div>


<script src="js/dateJs.fei.js"></script>
<script>
    $("#_submit").click(function () {
        if ($("#name").val()==""){
            alert("请输入内容")
            return false;
        }
        console.log(123);
        $.ajax({
            url:"/supply/save",
            type:"post",
            data:$("#supForm").serializeArray(),
            success:function (data) {

                if (data!="false") {
                    alert("发布成功")
                }else {
                    alert("发布失败")
                }
            },
            error:function (data) {
                alert("出错了，请重试")
            }
        })
    })

</script>